/*
 * Copyright 2008 Carnegie Mellon University
 * Licensed under the Apache License, Version 2.0 (the "License"); 
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, 
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package edu.cmu.lti.sepia.infra.system.model;

public class UploadedFile {
  
  private int fileId;
  private int userId; // user id of the user who uploaded the file
  private int taskId; // with which task is the file associated with?
  private String date; // date uploaded
  private String fileName; // name of the file
  private String filePath; // relative path to the file (e.g. type/fileName)
  private String type; // what kind of file it is
  private String description; // description of the file
  private int size; // file size in byte
  private FilePermission permission; // who can download this file?
  
  /**
   * @param fileId
   * @param userId
   * @param taskId
   * @param date
   * @param fileName
   * @param filePath
   * @param type
   * @param description
   * @param size
   */
  public UploadedFile(int fileId, int userId, int taskId, String date, String fileName, String filePath,
          String type, String description, int size, FilePermission permission ) {
    this.fileId = fileId;
    this.userId = userId;
    this.taskId = taskId;
    this.date = date;
    this.fileName = fileName;
    this.filePath = filePath;
    this.type = type;
    this.description = description;
    this.size = size;
    this.permission = permission!=null?permission:new FilePermission(fileId);
  }
  
  public UploadedFile() {
    
  }
  
  /**
   * @return the fileId
   */
  public int getFileId() {
    return fileId;
  }
  /**
   * @param fileId the fileId to set
   */
  public void setFileId(int fileId) {
    this.fileId = fileId;
  }
  /**
   * @return the userId
   */
  public int getUserId() {
    return userId;
  }
  /**
   * @param userId the userId to set
   */
  public void setUserId(int userId) {
    this.userId = userId;
  }
  /**
   * @return the date
   */
  public String getDate() {
    return date;
  }
  /**
   * @param date the date to set
   */
  public void setDate(String date) {
    this.date = date;
  }
  /**
   * @return the fileName
   */
  public String getFileName() {
    return fileName;
  }
  /**
   * @param fileName the fileName to set
   */
  public void setFileName(String fileName) {
    this.fileName = fileName;
  }
  /**
   * @return the filePath
   */
  public String getFilePath() {
    return filePath;
  }
  /**
   * @param filePath the filePath to set
   */
  public void setFilePath(String filePath) {
    this.filePath = filePath;
  }
  /**
   * @return the type
   */
  public String getType() {
    return type;
  }
  /**
   * @param type the type to set
   */
  public void setType(String type) {
    this.type = type;
  }
  /**
   * @return the description
   */
  public String getDescription() {
    return description;
  }
  /**
   * @param description the description to set
   */
  public void setDescription(String description) {
    this.description = description;
  }
  /**
   * @return the size
   */
  public int getSize() {
    return size;
  }
  /**
   * @param size the size to set
   */
  public void setSize(int size) {
    this.size = size;
  }

  /**
   * @return the taskId
   */
  public int getTaskId() {
    return taskId;
  }

  /**
   * @param taskId the taskId to set
   */
  public void setTaskId(int taskId) {
    this.taskId = taskId;
  }

  /**
   * @return the permission
   */
  public FilePermission getPermission() {
    return permission;
  }

  /**
   * @param permission the permission to set
   */
  public void setPermission(FilePermission permission) {
    this.permission = permission;
  }

  
}
